/**
 * Created by arons on 16/6/30.
 */

var xiaoming = {
    name: '小明',
    age: 14,
    gender: true,
    height: 1.65,
    grade: null,
    'middle-school': '\"W3C\" Middle School',
    skills: ['JavaScript', 'Java', 'Python', 'Lisp'],
    toJSON(){
        return {
            "Name": this.name,
            "Age": this.age
        }
    }
};

var jsonStr = JSON.stringify(xiaoming, null, "  ")
console.log(jsonStr)

var stu = JSON.parse(jsonStr);
console.log(stu)